/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.upn.sigemfi.rec.beans;

import edu.upn.sigemfi.rec.bc.CompromisoPagoDelegate;
import edu.upn.sigemfi.rec.be.CompromisoPago;


public class CompromisoPagoController {

    private CompromisoPagoDelegate delegado;
    private CompromisoPago compromisoPago;

    public String nuevo() {
        compromisoPago = new CompromisoPago();
        return "nuevo";
    }

    public String registrar(CompromisoPago compromisoPago) {
        try {
            delegado.crear(compromisoPago);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return "volver";
    }

    public String editar(CompromisoPago compromisoPago) {
        try {
            delegado.editar(compromisoPago);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return "volver";
    }

    public String eliminar(CompromisoPago compromisoPago) {
        try {
            delegado.eliminar(compromisoPago);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return "volver";
    }

    public CompromisoPago buscar(long codigo) {
        try {
            return delegado.buscar(codigo);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return null;
    }
}
